<template>
  <div class="loading">
    <div class="container">
      <span></span>
      <span></span>
      <span></span>
      <span></span>
    </div>
  </div>
</template>

<script>
export default {};
</script>

<style lang="less" scoped>
@keyframes loading {
  from {
    transform: scaleY(0.2);
  }
  to {
    transform: scaleY(1);
  }
}
.loading {
  width: 100%;
  display: flex;
  justify-content: center;
  .container {
    width: 20px;
    display: flex;
    justify-content: space-between;
    span {
      width: 2px;
      height: 20px;
      background-color: red;
      transform-origin: bottom;
      border-top-left-radius: 10px;
      border-top-right-radius: 10px;
      animation: loading 0.3s linear infinite alternate;
      &:nth-child(1) {
        animation-delay: -0.3s;
      }
      &:nth-child(2) {
        animation-delay: -0.2s;
      }
      &:nth-child(3) {
        animation-delay: -0.1s;
      }
      &:nth-child(4) {
        animation-delay: 0s;
      }
    }
  }
}
</style>